﻿using System;
using System.Windows;
using System.Windows.Input;
using Avivo.Tools.Sprite.Models;

namespace Avivo.Tools.Sprite
{
	public class ResetCommand : ICommand
	{
		#region Private members
		private SpriteViewModel parent;
		#endregion

		#region Constructor
		public ResetCommand(SpriteViewModel parent)
		{
			this.parent = parent;
		}
		#endregion

		#region ICommand Members
		public bool CanExecute(object parameter)
		{
			return true;
		}

		public event EventHandler CanExecuteChanged;

		public void Execute(object parameter)
		{
			if (MessageBox.Show("Are you sure?", "Clear", MessageBoxButton.YesNo, MessageBoxImage.Question) == MessageBoxResult.Yes)
			{
				this.parent.Clear();
			}
		}
		#endregion
	}
}
